﻿namespace Loki.Client
{
    //loki/api/v1/query_range?direction=BACKWARD&limit=1000&query=%7Bapp%3D%22qms%22%7D&start=1729478717175000000&end=1729500317176000000&step=20
    public class LokiQueryRange : LokiQueryBase
    {
        #region primary

        private string _direction = "backward";  //BACKWARD、forward 、backward

        #endregion

        public string direction
        {
            get
            {
                if (sortAsc.HasValue)
                {
                    if (sortAsc.Value)
                    {
                        return "forward";
                    }
                    return "backward";
                }

                if (string.IsNullOrEmpty(_direction))
                {
                    return "backward";
                }
                return _direction;
            }

            set
            {
                _direction = value;
            }
        }

        public int limit { get; set; } = 1000; //1000

        public string step { get; set; } = "20"; //20

        public string since { get; set; }

        public string interval { get; set; }

        public bool? sortAsc { get; set; }

    }
}
